#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define filename "log.txt"
int main ()
{
  fprintf(stdout,"hello normal msg\n");
  fprintf(stdout,"hello normal msg\n");
  
  fprintf(stdout,"hello normal msg\n");
  fprintf(stdout,"hello normal msg\n");
  fprintf(stdout,"hello normal msg\n");
  fprintf(stderr,"hello error msg\n");
  
  fprintf(stderr,"hello error msg\n");
  fprintf(stderr,"hello error msg\n");
  fprintf(stderr,"hello error msg\n");
  fprintf(stderr,"hello error msg\n");
  //int fd = open(filename,O_CREAT|O_WRONLY|O_TRUNC,0666);
  ////重定向``
  //dup2(fd,1);
  //close(fd);
  //const char *msg="hello bit\n";
  //int cnt=5;
  //printf("fd:%d\n",fd);
  //while(cnt--){
  //  write(1,msg,strlen(msg));
  //}
  //close(fd);
  return 0;
}
